package controller.admin.employee;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import service.Impl.EmployeeServiceImpl;
import util.ResultUtil;

import java.io.IOException;
@WebServlet("/admin/employee/status")
public class EmployeeStatusController extends HttpServlet {
    //修改员工账号状态
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        EmployeeServiceImpl service=new EmployeeServiceImpl();
        String id=req.getParameter("id");
        int ID= Integer.parseInt(id);
        service.UpdateStatus(ID);
        String json= ResultUtil.getJSON(null);
        resp.getWriter().write(json);

    }
}
